package com.dkd.manage.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.dkd.common.annotation.Log;
import com.dkd.common.core.controller.BaseController;
import com.dkd.common.core.domain.AjaxResult;
import com.dkd.common.enums.BusinessType;
import com.dkd.manage.domain.ZcglDsjZcps3;
import com.dkd.manage.service.IZcglDsjZcps3Service;
import com.dkd.common.utils.poi.ExcelUtil;
import com.dkd.common.core.page.TableDataInfo;

/**
 * 数据表三Controller
 * 
 * @author ITfuck
 * @date 2025-02-15
 */
@RestController
@RequestMapping("/manage/zcps3")
public class ZcglDsjZcps3Controller extends BaseController
{
    @Autowired
    private IZcglDsjZcps3Service zcglDsjZcps3Service;

    /**
     * 查询数据表三列表
     */
    @PreAuthorize("@ss.hasPermi('manage:zcps3:list')")
    @GetMapping("/list")
    public TableDataInfo list(ZcglDsjZcps3 zcglDsjZcps3)
    {
        startPage();
        List<ZcglDsjZcps3> list = zcglDsjZcps3Service.selectZcglDsjZcps3List(zcglDsjZcps3);
        return getDataTable(list);
    }

    /**
     * 导出数据表三列表
     */
    @PreAuthorize("@ss.hasPermi('manage:zcps3:export')")
    @Log(title = "数据表三", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ZcglDsjZcps3 zcglDsjZcps3)
    {
        List<ZcglDsjZcps3> list = zcglDsjZcps3Service.selectZcglDsjZcps3List(zcglDsjZcps3);
        ExcelUtil<ZcglDsjZcps3> util = new ExcelUtil<ZcglDsjZcps3>(ZcglDsjZcps3.class);
        util.exportExcel(response, list, "数据表三数据");
    }

    /**
     * 获取数据表三详细信息
     */
    @PreAuthorize("@ss.hasPermi('manage:zcps3:query')")
    @GetMapping(value = "/{ND}")
    public AjaxResult getInfo(@PathVariable("ND") Long ND)
    {
        return success(zcglDsjZcps3Service.selectZcglDsjZcps3ByND(ND));
    }

    /**
     * 新增数据表三
     */
    @PreAuthorize("@ss.hasPermi('manage:zcps3:add')")
    @Log(title = "数据表三", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ZcglDsjZcps3 zcglDsjZcps3)
    {
        return toAjax(zcglDsjZcps3Service.insertZcglDsjZcps3(zcglDsjZcps3));
    }

    /**
     * 修改数据表三
     */
    @PreAuthorize("@ss.hasPermi('manage:zcps3:edit')")
    @Log(title = "数据表三", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ZcglDsjZcps3 zcglDsjZcps3)
    {
        return toAjax(zcglDsjZcps3Service.updateZcglDsjZcps3(zcglDsjZcps3));
    }

    /**
     * 删除数据表三
     */
    @PreAuthorize("@ss.hasPermi('manage:zcps3:remove')")
    @Log(title = "数据表三", businessType = BusinessType.DELETE)
	@DeleteMapping("/{NDs}")
    public AjaxResult remove(@PathVariable Long[] NDs)
    {
        return toAjax(zcglDsjZcps3Service.deleteZcglDsjZcps3ByNDs(NDs));
    }
}
